﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="UC_Phong_TheoTinhTrang.ascx.cs" Inherits="QuanLyKhachSan.UC_Phong_TheoTinhTrang" %>
<%@ Register Assembly="Telerik.Web.UI, Version=2011.2.712.35, Culture=neutral, PublicKeyToken=121FAE78165BA3D4" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register src="../QuanLyKhachHang/UC_KhachHang_List.ascx" tagname="UC_KhachHang_List" tagprefix="uc1" %>
<style type="text/css">
    .comment-right-col
    {
        background: none repeat scroll 0 0 #FAFAFA;
        border: 1px solid #CFD6E0;
        border-radius: 5px 5px 5px 5px;
        color: #313C46;
        float: left;
        font-size: 1.083em;
        padding: 10px 20px;
        position: relative;
        width: 1000px;
        }
     .comment-nav
     {
        background: none repeat scroll 0 0 #F3F5F9;
        border-bottom: 1px solid #CFD6E0;
        border-radius: 5px 5px 0 0;
        font-size: 0.923em;
        list-style: none outside none;
        margin: -10px -20px 10px;
        padding: 12px 20px 10px;
        width: 100%;
         }
    .rp {
        float: left;
        font-weight: 900;
        margin-right: 20px;
        padding-bottom: 10px;
        width: 80px;
    }
    .cbooked {
    background: none repeat scroll 0 0 #4A8BAF;
    border-color: #4A8BAF !important;
    }
    .cstay {
        background: none repeat scroll 0 0 #024367;
    }
</style>
<!-- Context Menu DataList-->
<script src='<%=ResolveUrl("~/Scripts/jquery-1.4.1.min.js") %>' type="text/javascript"></script>
<link href='<%=ResolveUrl("~/Plugin/ContextMenu/jquery.contextMenu.css")%>' rel="stylesheet" type="text/css" />
<script src='<%=ResolveUrl("~/Plugin/ContextMenu/jquery.contextMenu.js") %>' type="text/javascript"></script>
<script type="text/javascript" language="javascript">
    $(document).ready(function () {
        // Show menu when #myDiv is clicked
        try {
            $("table[id^='FullMenu']").contextMenu({
                menu: 'fullMenu'
            },
		    function (action, el, pos) {
		        alert(
						    'Action: ' + action + '\n\n' +
						    'Element ID: ' + $(el).attr('id') + '\n\n' +
						    'X: ' + pos.x + '  Y: ' + pos.y + ' (relative to element)\n\n' +
						    'X: ' + pos.docX + '  Y: ' + pos.docY + ' (relative to document)'
						    );
		    });
            $("table[id^='TinyMenu']").contextMenu({
                menu: 'tinyMenu'
            },
		    function (action, el, pos) {
		        var PhongID;
		        var ael = new Array();
		        ael = $(el).attr('id').toString().split("_");
		        PhongID = ael[1];
		        switch (action) {
		            case "thongtinphong":
		                frmThongTinPhong_Open(PhongID);
		                break;
		        }
		        //		        alert(
		        //						    'Action: ' + action + '\n\n' +
		        //						    'Element ID: ' + $(el).attr('id') + '\n\n' +
		        //						    'X: ' + pos.x + '  Y: ' + pos.y + ' (relative to element)\n\n' +
		        //						    'X: ' + pos.docX + '  Y: ' + pos.docY + ' (relative to document)'
		        //						    );
		    });
            //format grid
            var aTable = $("table[id^='FullMenu']");
            for (var i = 0; i < aTable.length; i++) {
                //còn trống
                if (aTable[i].lang == "1") {
                    aTable[i].style.backgroundColor = "White";
                }
                //cần sửa
                if (aTable[i].lang == "4") {
                    aTable[i].style.backgroundColor = "Red";
                }
            }
            aTable = $("table[id^='TinyMenu']");
            for (var i = 0; i < aTable.length; i++) {
                //còn trống
                if (aTable[i].lang == "1") {
                    aTable[i].style.backgroundColor = "White";
                }
                //cần sửa
                if (aTable[i].lang == "4") {
                    aTable[i].style.backgroundColor = "Red";
                }
            }
        } catch (e) {
            alert(e);
        }
    });
    function frmThongTinPhong_Open(PhongID) {
        try {
            var URL = '<%=ResolveUrl("~/Pages/PopUp.aspx")%>';
            URL += "?UCName=UC_Phong_ThongTinPhong&UCPath=QuanLyPhong&PhongID=" + PhongID;
            var oRadWindowManager = $find("<%= RadWindowManager1.ClientID %>");
            var frmThongTinPhong = oRadWindowManager.open(URL, "frmThongTinPhong");
            frmThongTinPhong.SetSize(500, 400);
        } catch (e) {
            alert(e);
        }
    }	
</script>
<ul id="tinyMenu" class="contextMenu">
	<li class="edit"><a href="#thongtinphong">Thông tin phòng</a></li>
</ul>
<ul id="fullMenu" class="contextMenu">
	<li class="edit"><a href="#thongtinphong">Thông tin phòng</a></li>
    <li class="edit"><a href="#danhsachkhachhang">Danh sách khách hàng</a></li>
    <li class="edit"><a href="#xemthemdichvu">Xem/Thêm dịch vụ</a></li>
    <li class="edit"><a href="#chuyenphong">Chuyển phòng</a></li>
    <li class="edit"><a href="#capnhatngayradutinh">Cập nhật ngày ra dự tính</a></li>
	<li class="edit"><a href="#traphong">Trả phòng</a></li>
</ul>
<!-- End Context Menu DataList-->
<!--Popup Thong Tin Phong -->
  <telerik:RadWindowManager ID="RadWindowManager1" runat="server" 
            EnableShadow="true" Skin="Windows7" Modal="true" VisibleStatusbar="false" >
            <Windows>
                 <telerik:RadWindow  
                    id="frmThongTinPhong" 
                    runat="server"
                    showcontentduringload="false"
                    width="530px"
                    height="400px"
                    title="Cập nhật loại phòng"
                    behaviors="Close,Move,Resize,Maximize"  Animation="Resize" ReloadOnShow="true">
                </telerik:RadWindow>
            </Windows>
  </telerik:RadWindowManager>
<!-- -->
<table width="100%">
    <tr>
        <td>
            <div class="comment-right-col">
                    <span class="comment-tail"></span>
                    <ul class="comment-nav">                               
                           <li style=" font-weight:bold">Danh sách phòng</li>
                    </ul> 
                    <table>
                        <tr>
                            <td>
                                <div style="width:15px;height:15px;background-color:White;border:1px Solid Black">
                                
                                </div>
                            </td>
                            <td>
                                Còn trống
                            </td>
                            <td>
                                <div style="width:15px;height:15px;background-color:#4A8BAF;border:1px Solid Black">
                                
                                </div>
                            </td>
                            <td>
                                Đã đặt
                            </td>
                            <td>
                                <div style="width:15px;height:15px;background-color:Green;border:1px Solid Black">
                                
                                </div>
                            </td>
                            <td>
                                Đang ở
                            </td>
                            <td>
                                <div style="width:15px;height:15px;background-color:Red;border:1px Solid Black">
                                
                                </div>
                            </td>
                            <td>
                                Cần sửa
                            </td>
                            <td>
                                <div style="width:15px;height:15px;background-color:Yellow;border:1px Solid Black">
                                
                                </div>
                            </td>
                            <td>
                                Chưa dọn
                            </td>
                            <td>
                                <div style="width:15px;height:15px;background-color:Purple;border:1px Solid Black">
                                
                                </div>
                            </td>
                            <td>
                                Rời phòng
                            </td>
                        </tr>
                    </table>
                    <asp:DataList ID="dlPhong" runat="server" RepeatColumns="15" RepeatDirection="Horizontal" Width="100%">
                        <ItemTemplate>
                            <table id='<%# ContextMenu(Eval("PhongID").ToString(),Eval("TinhTrangPhongID").ToString())%>' lang='<%#Eval("TinhTrangPhongID")%>' style="cursor:pointer;width:50px;height:50px;background-color:Green;border:1px Solid Black">
                                <tr align="center" valign="middle">
                                    <td valign="middle" align="center" style=" font-weight:bold">
                                            <%#Eval("PhongName")%>                     
                                    </td>
                                </tr>
                            </table>
                             <br />
                        </ItemTemplate>
                    </asp:DataList>
            </div>        
        </td>
    </tr>
    <tr>
        <td>
            <br />
        </td>
    </tr>
    <tr>
        <td>
            <div class="comment-right-col">
                    <span class="comment-tail"></span>
                    <ul class="comment-nav">                               
                           <li style=" font-weight:bold">Khách hàng đang ở và đã đặt</li>
                    </ul>                     
                    <uc1:UC_KhachHang_List ID="UC_KhachHang_List1" runat="server" />
            </div>        
        </td>
    </tr>
</table>


